package com.bling.action.base;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
/**
 * 基本业务逻辑
 * 包含：获取request、response、session和错误信息以及验证码，只是在需要的时候获取
 * 		  验证码由子类实现完成赋值操作
 * @author BLingSoft
 *
 */
public class BaseAction extends ActionSupport {
	private static final long serialVersionUID = -8856198817977905203L;

	protected HttpServletRequest request;
	protected HttpServletResponse response;
	protected Map<String,Object> session;
	
	private String code; // 验证码输入值
	private String codetext; // 验证码提示文字
	private String rightcode; //正确验证码值
	private String errormsg; // 错误提示信息
	
	public HttpServletRequest getRequest() {
		request = ServletActionContext.getRequest();
		return request;
	}
	public HttpServletResponse getResponse() {
		response = ServletActionContext.getResponse();
		return response;
	}
	public Map<String,Object> getSession() {
		session = ActionContext.getContext().getSession();
		return session;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getRightcode() {
		return rightcode;
	}
	public void setRightcode(String rightcode) {
		this.rightcode = rightcode;
	}
	public String getErrormsg() {
		return errormsg;
	}
	public void setErrormsg(String errormsg) {
		this.errormsg = errormsg;
	}
	public String getCodetext() {
		return codetext;
	}
	public void setCodetext(String codetext) {
		this.codetext = codetext;
	}
}
